package com.e3.basdoc.corp.client;

import com.e3.basdoc.corp.model.CorpModel;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFTabFormPanel;
import com.e3.web.core.client.GwtAsyncCallback;
import com.google.gwt.user.client.Element;

public class CorpEditorDialog extends TGFEditorDialog<CorpModel> {
	
	private CorpRPCServiceAsync service = CorpRPCService.Util.getInstance();
	
	@Override
	protected void onRender(Element parent, int pos) {
		super.onRender(parent, pos);
		this.setSize(600, 550);
	}

	@Override
	public TGFTabFormPanel<CorpModel> createFormPanel() {
		return new CorpFormPanel();
	}

	@Override
	public void executeNewService(CorpModel model,GwtAsyncCallback<CorpModel> callback) {
		service.newCorp(model, callback);
	}

	@Override
	public void executeModifyService(CorpModel model,GwtAsyncCallback<CorpModel> callback) {
		service.modifyCorp(model, callback);
	}

	@Override
	public String[] getNotNullFieldNames() {
		return CorpHelper.INSTANCE.getNotNullFieldNames();
	}
}
